package com.wuye.web;

import com.wuye.model.MenuPropers;

import java.util.*;

public class UserSession {
	private String userId;
	public String getUserId(){
		return this.userId;
	}
	public void setUserId(String arg){
		this.userId=arg;
	}
    private String cellPhone;
    private String userName;
    private List<ShoppingCartItem> shoppingCart;
    private Integer suggestId;
    private Integer modelId;

    public Integer getSuggestId() {
        return suggestId;
    }

    public void setSuggestId(Integer suggestId) {
        this.suggestId = suggestId;
    }

    public Integer getModelId() {
        return modelId;
    }

    public void setModelId(Integer modelId) {
        this.modelId = modelId;
    }
    public String getCellPhone() {
        return this.cellPhone;
    }
    public void setCellPhone(String arg) {
        this.cellPhone = arg;
    }

    public String getUserName() {
        return this.userName;
    }

    public void setUserName(String arg) {
        this.userName = arg;
    }

    public List<ShoppingCartItem> getShoppingCart() {
        return this.shoppingCart;
    }

    public void setShoppingCart(List<ShoppingCartItem> arg) {
        this.shoppingCart = arg;
    }

    public Float getTotalPrice() {
        if (shoppingCart == null) return 0.0F;
        Float totalPrice = 0.0F;
        for (ShoppingCartItem i : shoppingCart) {
            totalPrice = totalPrice + i.getAmount();
        }
        return totalPrice;
    }

    private MenuPropers menus = new MenuPropers();

    public MenuPropers getMenus() {
        return menus;
    }

    public void setMenus(MenuPropers menus) {
        this.menus = menus;
    }

    public UserSession(String userId, String cellPhone, String userName, List<ShoppingCartItem> shoppingCart, MenuPropers menus) {
        this.userId = userId;
        this.cellPhone = cellPhone;
        this.userName = userName;
        this.shoppingCart = shoppingCart;
        this.menus = menus;
    }

    public UserSession() {
    }

    @Override
    public String toString() {
        return "UserSession{" +
                "userId='" + userId + '\'' +
                ", cellPhone='" + cellPhone + '\'' +
                ", userName='" + userName + '\'' +
                ", shoppingCart=" + shoppingCart +
                ", menus=" + menus +
                '}';
    }
}